#include <iostream>
#include <cstring>
using namespace std;

const int N = 5e4 + 10, M = 110;

int f[M][N], p[M], c[M];
int n, h;

int main()
{
	cin >> n >> h;
	for(int i = 1; i <= n; i++) cin >> p[i] >> c[i];
	memset(f, 0x3f, sizeof f);
	f[0][0] = 0;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 0; j <= h; j++)
		{
			f[i][j] = min(f[i - 1][j], f[i][max(j - p[i], 0)] + c[i]);
		}
	}
	cout << f[n][h] << endl;
	return 0;
} 
